Conversation
|
rustbot has assigned @JonathanBrouwer. Use |
This comment has been minimized.
This comment has been minimized.
46d6c3e to
d89022a
Compare
This comment has been minimized.
This comment has been minimized.
9478bfd to
fa35f7b
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
☔ The latest upstream changes (presumably #149853) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts. |
|
Triage: Are you still working on this @xacrimon? |
fa35f7b to
7054408
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| ); | ||
|
|
||
| this.maybe_forward_track_caller(body.span, closure_hir_id, expr.hir_id); | ||
| this.forward_inline(body.span, closure_hir_id, expr.hir_id); |
There was a problem hiding this comment.
Could you add some tests for this feature?
There was a problem hiding this comment.
From the lang team decision:
We talked about this in the lang call today. We want attributes like this to apply to "where the code is", i.e. to the poll function in this case. The wrapper function, on the other hand, should always be inlined.
Make sure your tests cover this.
I suspect the wrapper function is already marked as inline somewhere, if it is not could you or someone else open a separate PR that does this?
There was a problem hiding this comment.
The wrapper function is automatically marked as inline by the automating inlining of small functions in every case I tested, since it just returns a hardcoded value.
|
Sorry for taking so long to review this PR! This PR fell of my radar, thanks @Dylan-DPC for fixing up the label so I saw it again |
…poll impl instead of the desugared creator function.
7054408 to
0c5f331
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@Enselic yep, I was too busy to work on this for an extended amount of time. but now I have time again and intend to see it merged. |
|
I have now rebased the PR onto the current main, this required a fundemental approach change due some issues I found with lints being incorrectly applied after modifying the HIR in addition to the area of the codebase where I made my change being largely rewritten in the meantime in a way that wasn't amenable to the previous approach. We now handle this in a later step in IR gen, which after talking to some people on Zulip, seems like the better place to do it now. |
|
@rustbot ready |
|
since so much time has passed, do you still want to review this or should I reassign? @JonathanBrouwer |
This PR adds lowering code (similar to how track_caller forwarding works) to
async fnitems andasync ||closures such that any inline attributes put on them are inherited by the generated coroutine (corresponding to thepoll()implementation) and are not applied to the outer function. This behavior matches the accepted FCP in the first linked issue.Code like the following now correctly codegen 3 functions
async_fn_test::consumerasync_fn_test::hi::{closure#0}core::ptr::drop_in_place::<async_fn_test::hi::{closure#0}>Fixes #129347 and fixes #106765.
This has already been FCP'ed here: #129347